package com.chucang.shucang.usr.feign;

import com.chucang.shucang.common.base.constant.SecurityConstant;
import com.chucang.shucang.common.base.utils.R;
import com.chucang.shucang.usr.entity.UserBlindBoxHoldEntity;
import com.chucang.shucang.usr.entity.UserCollectionHoldEntity;
import com.chucang.shucang.usr.feign.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author flitsneak
 * @email flitsneak@gmail.com
 * @date 2022/10/4 18:22
 * @description
 */
@FeignClient(contextId = "usr-pms", value = "shucang-pms")
public interface PmsService {

    @GetMapping("/pms/collectionbase/getCollectionBaseInfo/{id}")
    R<CollectionBaseEntity> getCollectionBaseInfo(@PathVariable("id") Long id, @RequestHeader(SecurityConstant.FROM) String from);

    @GetMapping("/pms/blindboxbase/getBlindBoxBaseInfo/{id}")
    R<BlindBoxBaseEntity> getBlindBoxBaseInfo(@PathVariable("id") Long id, @RequestHeader(SecurityConstant.FROM) String from);

    @PostMapping("/pms/collectionmall/collectionsOnConsign")
    R<String> collectionsOnConsign(@RequestBody List<UserCollectionHoldEntity> userCollectionHoldList, @RequestHeader(SecurityConstant.FROM) String from);

    @PostMapping("/pms/blindboxmall/blindBoxesOnConsign")
    R<String> blindBoxesOnConsign(@RequestBody List<UserBlindBoxHoldEntity> userBlindBoxHoldList, @RequestHeader(SecurityConstant.FROM) String from);

    @GetMapping("/pms/blindboxmall/withdrawBlindBoxConsign/{id}")
    R<String> withdrawBlindBoxConsign(@PathVariable("id") Long id, @RequestHeader(SecurityConstant.FROM) String from);

    @GetMapping("/pms/collectionmall/withdrawCollectionConsign/{id}")
    R<String> withdrawCollectionConsign(@PathVariable("id") Long id, @RequestHeader(SecurityConstant.FROM) String from);

    @GetMapping("/pms/blindboxbasicplay/openBlindBox/{id}/{serialNum}")
    R<BlindBoxBasicOpenResVO> openBlindBox(@PathVariable("id") Long id, @PathVariable("serialNum") Integer serialNum, @RequestHeader(SecurityConstant.FROM) String from);

    @GetMapping("/pms/collectionmall/lockCollectionStock/{id}/{userId}")
    R<CollectionMallEntity> lockCollectionStock(@PathVariable("id") Long id, @PathVariable("userId") Long userId, @RequestHeader(SecurityConstant.FROM) String from);

    @GetMapping("/pms/blindboxmall/lockBlindBoxStock/{id}/{userId}")
    R<BlindBoxMallEntity> lockBlindBoxStock(@PathVariable("id") Long id, @PathVariable("userId") Long userId, @RequestHeader(SecurityConstant.FROM) String from);

    @GetMapping("/pms/collectionsynthetic/getCollectionSyntheticRules/{id}/{rule}")
    R<List<CollectionSyntheticEntity>> getCollectionSyntheticRules(@PathVariable("id") Long id, @PathVariable("rule") Integer rule, @RequestHeader(SecurityConstant.FROM) String from);
}
